@extends('layout.admin.master')
@section('content')
    <form action="{{route('permission.role.setingPermission',$user)}}" method="post">
        @csrf
        <div class="card">
            <div class="card-body">
                <ul class="nav nav-tabs nav-tabs-sm">
                    <li class="nav-item">
                        <a href="javascript:;" class="nav-link active">
                            角色列表
                        </a>
                    </li>
                </ul>

                  <div class="row">
                      @foreach($roles as$k=> $role)
                      <div class="col-3">
                          <div class="form-check">
                              <input name="role[]" class="form-check-input" type="checkbox"
                                     id="role{{$k}}" value="{{$role['name']}}" @if($user->hasRole($role['name']))  checked @endif>
                              <label class="form-check-label" for="role{{$k}}">
                                  <strong>{{$role['cname']}}</strong>
                              </label>
                          </div>
                      </div>
                      @endforeach
                  </div>

            </div>
            <div class="card-footer text-muted">
                <button type="submit" class="btn btn-primary">设置角色</button>
            </div>
        </div>
    </form>
@endsection

